<template>
    <el-container>
        <el-header>
            <el-page-header @back="goBack" content="关注列表">
            </el-page-header>
        </el-header>
        <el-main>
            <!--<el-table :data="subscribeList" >-->

                <!--<el-table-column prop="avatar" label="头像">-->
                    <!--&lt;!&ndash;<template>&ndash;&gt;-->
                        <!--&lt;!&ndash;<el-image :src="subscribeList[scop.$index].avatar"/>&ndash;&gt;-->
                        <!--&lt;!&ndash;<img :src="subscribeList[scop.$index].avatar">&ndash;&gt;-->
                    <!--&lt;!&ndash;</template>&ndash;&gt;-->

                <!--</el-table-column>-->
                <!--<el-table-column prop="username" label="用户名">-->

                <!--</el-table-column>-->
            <!--</el-table>-->
          <el-card v-for="item in subscribeList" :key="item.username" shadow="hover">
            <img style="max-height: 100%;max-width: 100%;height:50px;width:50px;" :src="item.avatar" alt=""/>
            <span style="margin-left: 10px;font-size:20px">{{item.username}}</span>
          </el-card>

        </el-main>

    </el-container>

</template>

<script>
    import axios from "axios";
    export default {

        name: "SubscribeList",

        data() {
            return {
                subscribeList:[],
                    // user: 'lisi',
                user: this.$store.state.userinfo.user!=null?this.$store.state.userinfo.user.user.username:'',
            }

        },

        methods:{
          goBack(){
              // console.log('go back');
              this.$router.back();
          }
        },
        created(){
            // axios.get('http://localhost:8080/subscribeList?username='+this.user).then(
            //     Response=>{
            //         this.subscribeList = Response.data.data.subscribeList;
            //         // console.log(this.subscribeList[0].avatar);
            //     }
            // )
            var _this = this;
            _this.axios({
                method: "get",
                url: "/subscribeList?username="+_this.user,
            }).then(function (resp) {
                _this.subscribeList = resp.data.data.subscribeList;
            })
        }
    }

</script>

<style scoped>

</style>